#!/bin/sh

productPara=$1
productNumber=(intel)
warringError="Please enter the correct parameters.( intel )"
isExist=
#获取脚本所在的目录
workdir=$(cd $(dirname $0); pwd)
# echo $workdir

#参数为空,错误提醒
if [ ! -n "$productPara" ] ;then
	echo $warringError
	exit;
fi

#遍历参数是否存在productNumber中(参数合法性判断)
for i in ${productNumber[@]}
do
	if [ $i == $productPara ]
	then
		isExist="yes"
		break
	fi
done

if [  ! -n "$isExist" ]
then
	echo $warringError
	exit;
fi



#对intel单独的定制进行配置
if [ $productPara = ${productNumber[0]} ]
then
	echo ""
	#将单独的配置文件拷贝到data/目录下
	cp -rvf $workdir/$productPara/data/config.desc $workdir/../data/.
	#将CMakeLists.txt文件拷贝到fcitx目录下，增加宏定义INTEL_PRODUCT_DEBUG
	cp -rvf $workdir/$productPara/CMakeLists.txt $workdir/../.
	#将debian/rules文件拷贝到fcitx/debian目录下，rules文件中打开宏
	cp -rvf $workdir/$productPara/debian/rules $workdir/../debian/.

	echo ""
fi

echo "finish..."



